<template>
  <BaseDialog
    ref="baseDialog"
    width="600px"
    title="合宇信息"
    @confrim="confrim"
  >
  <div v-if="info">
    <div class="item">
      <div>设备号</div>
      <div>{{ JSON.parse(info).imei }}</div>
    </div>
    <div class="item">
      <div>温度值</div>
      <div>{{ JSON.parse(info).temp }}</div>
    </div>
    <div class="item">
      <div>电量</div>
      <div>{{ JSON.parse(info).battery }}</div>
    </div>
    <div class="item">
      <div>开机运行模式</div>
      <div>{{ JSON.parse(info).workMode == 1 ? "运行模式" : "休眠模式" }}</div>
    </div>
    <div class="item">
      <div>板子硬件</div>
      <div>{{ JSON.parse(info).hardware  }}</div>
    </div>
    <div class="item">
      <div>最后开机时间
      </div>
      <div>{{ JSON.parse(info).lastOpTime  }}</div>
    </div>
    <div class="item">
      <div>无线信号强度

      </div>
      <div>{{ JSON.parse(info).rssi  }}</div>
    </div>
    <div class="item">
      <div>软件版本号
      </div>
      <div>{{ JSON.parse(info).ver  }}</div>
    </div>
  </div>
  <!-- {{ info }} -->
   
  </BaseDialog>
</template>

<script>
import { Message } from "element-ui";
export default {
  data() {
    return {
      info: null,
    };
  },
  methods: {
    open(data) {
      this.info = data;
      this.$refs.baseDialog.open();
    },

    confrim() {
      this.$emit("confrim", this.dot);
      this.close();
    },
    close() {
      this.$refs.baseDialog.close();
    },
  },
};
</script>

<style scoped>
.item {
  display: flex;
  border-bottom: 1px solid #ccc;
  margin-bottom: 5px;
  padding-bottom: 10px;
  div {
    width: 50%;
  }
  .detail {
    display: flex;
    flex-direction: column;
  }
}
</style>
